﻿using eService.BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace eService.Presentation
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            bool OK = false;
            OK = ConnectionProvider.LoadAllConnection();
            if (!OK)
            {
                //MessageBox.Show("Thông tin cấu hình không chính xác!\nVui lòng cấu hình hệ thống.", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                frmCauHinh cauhinh = new frmCauHinh();
                cauhinh.ShowDialog();
            }
            else
            {
                frmDangNhap login = new frmDangNhap();
                DialogResult res = login.ShowDialog();
                if (res == DialogResult.OK)
                {
                    //Welcome frmWel = new Welcome();
                    //DialogResult res1 = frmWel.ShowDialog();
                    //if (res1 == DialogResult.OK)
                    //{
                        Application.Run(new frmMain());
                    //}
                }
                else
                {
                    Application.Exit();
                }
            }
        }
    }
}
